const express = require('express')
const pool=require('../pool')
const router=express.Router()

router.post('/login',(req,res,next)=>{
    let obj = req.body
    pool.query('select * from UserLogin where uname = ?',[obj.uname],(err,r)=>{
        if(err){
            return next(err);
        }
        
        if(r[0].upassword==obj.upassword){
            res.send({code:200,msg:'用户登录成功',data:r})
        }
        
        
    })
})



module.exports=router